<template>
	<view class="container">
			<view class="example">
				<!-- 基础用法，不包含校验规则 -->
				<uni-forms ref="baseForm" :modelValue="baseFormData">
					<uni-forms-item label="姓名" required>
						<uni-easyinput v-model="baseFormData.name" placeholder="请输入姓名" />
					</uni-forms-item>
					<uni-forms-item label="性别" required>
						<uni-data-checkbox v-model="baseFormData.sex" :localdata="sexs" />
					</uni-forms-item>
					<uni-forms-item label="状态" required>
						<uni-data-checkbox v-model="baseFormData.types" :localdata="types" />
					</uni-forms-item>
					<uni-forms-item label="专业" required>
						<uni-easyinput v-model="baseFormData.introduction" placeholder="请输入专业" />
					</uni-forms-item>
				</uni-forms>
			</view>
			
			<button type="primary" @click="submit('baseForm')">提交</button>
		</uni-section>
	</view>
</template>

<script>

export default {
	data() {
		return {
			// 基础表单数据
			baseFormData: {
				name: '',
				major: '',
				sex: 0,
				types: 0,
			},
			sexs: [{
				text: '男',
				value: 0
			}, {
				text: '女',
				value: 1
			}],
			types: [{
				text: '正常',
				value: 0
			}, {
				text: '异常（需要介入引导）',
				value: 1
			}],
		}
	},
	onLoad() {

	},
	onShow() {

	},
	methods: {

	},
}
</script>

<style>
	.example {
		padding: 15px;
		background-color: #fff;
	}

	.segmented-control {
		margin-bottom: 15px;
	}

	.button-group {
		margin-top: 15px;
		display: flex;
		justify-content: space-around;
	}

	.form-item {
		display: flex;
		align-items: center;
	}

	.button {
		display: flex;
		align-items: center;
		height: 35px;
		margin-left: 10px;
	}
</style>